/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 姚东名
 * Date: 2024-11-16
 * Time: 10:11
 */
import java.util.Scanner;
public class Demo2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        // 计算操作次数
        int count = countOperation(n);
        System.out.println(count);
    }

    private static int countOperation(int n) {
        int count = 0;
        while (n > 0) {
            // 计算当前数位上的数字，并累加到操作数上面
            count += n % 10;

            // 移除当前最低位数的数字
            n /= 10;
        }
        return count;
    }
}
